<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<base href="${BaseContext}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑视频</title>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
	crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
	integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
	crossorigin="anonymous">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"
	integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
	crossorigin="anonymous"></script>

<script type="text/javascript" src="static/js/jquery-1.8.3.js"></script>
<script type="text/javascript">
	$(function() {
		$(".navbar-nav li").mouseover(function() {
			$(this).addClass("active");
		});
		$(".navbar-nav li").mouseout(function() {
			$(this).removeClass("active");
		});
	})
</script>
<style type="text/css">
.jumbotron {
	width: 90%;
	margin: 0 auto;
	padding-left: 5%;
	border-radius: 5px;
}

#div1 {
	margin-top: 20px;
}

#div {
	width: 100%;
	min-width: 1000px;
}
</style>
</head>

<body>
	<div id="div">
		<nav class="navbar navbar-inverse navbar-fixed-top">
			<div class="container-fluid">
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed"
						data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
						aria-expanded="false">
						<span class="sr-only">Toggle navigation</span> <span
							class="icon-bar"></span> <span class="icon-bar"></span> <span
							class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="#" style="padding-left: 50px">视频管理系统</a>
				</div>
				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse"
					id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a href="admin/video">视频管理 <span class="sr-only">(current)</span></a></li>
						<li><a href="admin/speaker">主讲人管理</a></li>
						<li><a href="admin/course">课程管理</a></li>
						<li><a href="admin/statistics">统计分析</a></li>
					</ul>
					<ul class="nav navbar-nav navbar-right" style="padding-right: 50px">
						<li><a href="#">${admin.login_name }</a></li>
						<li><a href="admin/logout.do"><span
								class="glyphicon glyphicon-log-out" aria-hidden="true"></span></a></li>
					</ul>
				</div>
				<!-- /.navbar-collapse -->
			</div>
			<!-- /.container-fluid -->
		</nav>
		<div class="jumbotron">
			<h2>编辑视频信息 - 视频管理</h2>
		</div>
		<div class="container" id="div1" style="width: 90%">
			<form class="form-horizontal"
				action="admin/video/${video.id==null?'insert':'update'}" method="post">
				<input type="hidden" name="id" value="${video.id }">
				<div class="form-group">
					<label for="inputTitle3" class="col-sm-2 control-label">视频标题</label>
					<div class="col-sm-10">
						<input class="form-control" id="inputTitle3" name="video_title"
							value="${video.video_title }" placeholder="视频标题">
					</div>
				</div>
				<div class="form-group">
					<label for="inputPeople3" class="col-sm-2 control-label">主讲人</label>
					<div class="col-sm-10">
						<select class="form-control" id="inputPeople3" name="speaker_id">
							<option>请选择主讲人</option>
							<c:forEach items="${speakers }" var="s">
								<c:choose>
									<c:when test="${s.id==video.speaker_id }">
										<option selected="selected" value="${s.id }">${s.speaker_name }</option>
									</c:when>
									<c:otherwise>
										<option value="${s.id }">${s.speaker_name }</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="inputCourse3" class="col-sm-2 control-label">请选择课程</label>
					<div class="col-sm-10">
						<select class="form-control" id="inputCourse3" name="course_id">
							<option>请选择课程</option>
							<c:forEach items="${courses }" var="c">
								<c:choose>
									<c:when test="${c.id==video.course_id }">
										<option selected="selected" value="${c.id }">${c.course_name }</option>
									</c:when>
									<c:otherwise>
										<option value="${c.id }">${c.course_name }</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="inputSecond3" class="col-sm-2 control-label">视频时长(秒)</label>
					<div class="col-sm-10">
						<input type="number" class="form-control" id="inputSecond3"
							name="video_length" value="${video.video_length }"
							placeholder="视频时长(秒)">
					</div>
				</div>
				<div class="form-group">
					<label for="inputPicture3" class="col-sm-2 control-label">封面图片</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputPicture3"
							name="video_image_url" value="${video.video_image_url }"
							placeholder="视频封面图片地址,网络图片">
					</div>
				</div>
				<div class="form-group">
					<label for="inputAddr3" class="col-sm-2 control-label">视频播放地址</label>
					<div class="col-sm-10">
						<input class="form-control" id="inputAdde3" name="video_url"
							value="${video.video_url }" placeholder="视频播放地址,网络地址">
					</div>
				</div>
				<div class="form-group">
					<label for="inputVideo-in3" class="col-sm-2 control-label">视频简介</label>
					<div class="col-sm-10">
						<textarea rows="5" cols="80" type="course-in" class="form-control"
							name="video_descr" id="Video-in3">${video.video_descr }</textarea>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-primary">保存</button>
						<a href="admin/video" type="button" class="btn btn-default">返回列表</a>
					</div>
				</div>
			</form>
		</div>
</body>
</html>

